<template>
  <a-form :form="form" layout="vertical">
    <a-row :gutter="48">
      <a-col class="col-wrapper" :md="20" :sm="24">
        <a-col :md="12" :sm="24">
          <a-form-item
            label="学号"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input disabled v-decorator="[ 'xh']"/>
            <a-input v-decorator="['id']" type="hidden"/>
            <a-input v-decorator="['communityId']" type="hidden"/>
            <a-input v-decorator="['state']" type="hidden"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="姓名"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input disabled v-decorator="['xm']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="姓名拼音"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['xmpy']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="曾用名"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['cym']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="英文姓名"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['ywxm']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="证件类型"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['sfzjlxm']">
              <a-select-option v-for="i in TYPE0088" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="证件号码"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['zjhm']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="性别"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['xbm']">
              <a-select-option v-for="i in TYPE0011" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="血型"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['xxm']">
              <a-select-option v-for="i in TYPE0078" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="出生日期"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['csrq']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item style="width:100%" label="出生地" selfUpdate :labelCol="{}" :wrapperCol="{}">
            <a-select style="width:33%" @change="provinceChange" v-decorator="['csdsdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" @change="cityChange" v-decorator="['csdcdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.city" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" v-decorator="['csdxqdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.area" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="民族"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['mzm']">
              <a-select-option v-for="i in TYPE0017" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="港澳台侨"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['gatqm']">
              <a-select-option v-for="i in TYPE0037" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="健康状况"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['jkzkm']">
              <a-select-option v-for="i in TYPE0013" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="婚姻状况"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['hyzkm']">
              <a-select-option v-for="i in TYPE0012" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="家庭常住地址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['jtczzz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="户口所在地址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['hkszd']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="户口性质"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['hkxzm']">
              <a-select-option v-for="i in TYPE0002" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="国籍/地区"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" showSearch :filterOption="filterOption" v-decorator="['gjdqm']">
              <a-select-option v-for="i in TYPE0015" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="现住址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['xzz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="联系电话"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['lxdh']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="通信地址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['txdz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="电子邮箱"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['dzxx']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item style="width:100%" label="籍贯" selfUpdate :labelCol="{}" :wrapperCol="{}">
            <a-select style="width:33%" @change="provinceNativeChange" v-decorator="['jgsdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" @change="cityNativeChange" v-decorator="['jgcdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.nativeCity" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:33%" v-decorator="['jgxqdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.nativeArea" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="政治面貌"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['zzmmm']">
              <a-select-option v-for="i in TYPE0020" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="宗教信仰"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['xyzjm']">
              <a-select-option v-for="i in TYPE0001" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="身份证有效期"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['sfzjyxq']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="是否独生子女"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['sfdszn']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="学习方式"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['xxfs']">
              <a-select-option v-for="i in TYPE0305" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="宿舍电话"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['ssdh']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="实验室电话"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['sysdh']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="宿舍地址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['ssdz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="家庭电话"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['jtdh']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="家庭住址"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['jtzz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="家庭邮政编码"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['jyyzbm']"/>
          </a-form-item>
        </a-col>
        <!--        <a-col :md="12" :sm="24">-->
        <!--          <a-form-item-->
        <!--            label="本人成分"-->
        <!--            :labelCol="{}"-->
        <!--            :wrapperCol="{}"-->
        <!--            selfUpdate-->
        <!--          >-->
        <!--            <a-input v-decorator="['brcf']"/>-->
        <!--          </a-form-item>-->
        <!--        </a-col>-->
        <a-col :md="12" :sm="24">
          <a-form-item
            label="会何种外语"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['hhzwy']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="外语熟练程度"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['wyslcdm']">
              <a-select-option v-for="i in TYPE0024" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="入学前最后学历"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['rxqzhxlm']">
              <a-select-option v-for="i in TYPE0018" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="入学前最后学位"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['rxqzhxwm']">
              <a-select-option v-for="i in TYPE0023" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <!-- <a-col :md="12" :sm="24">
          <a-form-item
            label="大学毕业所在省份"
            :labelCol="{}"
            :wrapperCol="{}"
          >
            <a-select v-decorator="['dxbyxxszsf']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col> -->
        <a-col :md="12" :sm="24">
          <a-form-item
            label="大学毕业学校"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select style="width:50%" v-decorator="['dxbyxxszsf']" @change="e => handlePChange(e, '' , 'dxbyxxdm')"  :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%" v-decorator="['dxbyxxdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.schoolList" :key="i.communityId" :value="String(i.communityId)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="大学毕业年月"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['dxbyny']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="大学毕业专业"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['dxbyzydm']" @change="(value, option) => {setData(option, 'dxbyxy')}">
              <a-select-option v-for="i in TYPE0010" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="学士学位学科门类"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select :allowClear="true" v-decorator="['xsxwxkmldm']">
              <a-select-option v-for="i in TYPE0090" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item style="width:100%" label="授学士学位单位名称" selfUpdate :labelCol="{}" :wrapperCol="{}">
            <a-select style="width:50%" v-decorator="['dxbyxxszsf']" @change="e => handlePChange(e, '2' , 'sxsxwdwdm')" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['sxsxwdwdm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.schoolList2" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="硕士毕业学校"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['ssbyxxmc']" type="hidden"/>
            <a-select  v-decorator="['ssbyxxdm']" :allowClear="true" @change="(value, option) => {setData(option, 'ssbyxxmc')}">
              <a-select-option v-for="i in selectMenu.schoolList" :key="i.id" :value="String(i.communityId)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="硕士毕业年月"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['ssbyny']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="硕士毕业专业"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select  v-decorator="['ssbyzym']" :allowClear="true">
              <a-select-option v-for="i in TYPE0010" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="硕士学位学科门类"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select  v-decorator="['ssxwxkmlm']" :allowClear="true">
              <a-select-option v-for="i in TYPE0090" :key="i.id" :value="String(i.code)">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item style="width:100%" selfUpdate label="授硕士学位单位名称" :labelCol="{}" :wrapperCol="{}">
            <a-select style="width:50%" v-decorator="['ssbyxxdsf']" @change="e => handlePChange(e, '3' , 'sssxwdwm')" :allowClear="true">
              <a-select-option v-for="i in selectMenu.province" :key="i.areaCode" :value="String(i.areaCode)">{{ i.name }}</a-select-option>
            </a-select>
            <a-select style="width:50%"  v-decorator="['sssxwdwm']" :allowClear="true">
              <a-select-option v-for="i in selectMenu.schoolList3" :key="i.id" :value="String(i.xxmc)">{{ i.xxmc }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="何时参加工作"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['hscjgz']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="何地参加工作"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['hdcjgz']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="原工资级别"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['ygzjb']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="何时入党或团"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-date-picker v-decorator="['hsrdht']" style="width: 100%" format="YYYY-MM-DD"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="何地入党或团"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['hdrdht']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="配偶姓名"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['poxm']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="配偶政治面貌"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-select  v-decorator="['pozzmmm']" :allowClear="true">
              <a-select-option v-for="i in TYPE0020" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item
            label="配偶工作单位"
            :labelCol="{}"
            :wrapperCol="{}"
            selfUpdate
          >
            <a-input v-decorator="['pogzdw']"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label="配偶职位" selfUpdate :labelCol="{}" :wrapperCol="{}">
            <a-select  v-decorator="['pozw']" :allowClear="true">
              <a-select-option v-for="i in TYPE0006" :key="i.id" :value="i.code">{{ i.name }}</a-select-option>
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label="所在研究室或机构" selfUpdate :labelCol="{}" :wrapperCol="{}">
            <a-input v-decorator="['szjyshyjjg']"/>
          </a-form-item>
        </a-col>
      </a-col>
      <a-col :md="4" :sm="24">
        <a-form-item
            label=""
            :labelCol="{span: 0,offset: 1}"
            :wrapperCol="{span: 20, offset: 1}"
            selfUpdate
          >
          <a-upload
            name="file"
            style="width:80%"
            listType="picture-card"
            class="avatar-uploader"
            :showUploadList="false"
            action="http://test.ezmate.cn/upload/img"
            @change="handleChange"
          >
            <!-- :beforeUpload="beforeUpload" -->
            <img v-if="imageUrl" style="width:200px;" :src="imageUrl" alt="avatar" />
            <div v-else>
                <a-icon :type="loading ? 'loading' : 'plus'" />
                <div class="ant-upload-text">上传头像</div>
            </div>
          </a-upload>
        </a-form-item>
      </a-col>
    </a-row>
    <a-form-item style="margin-left: 24px;" selfUpdate label="参加过哪些研究工作">
      <a-input type="textarea" v-decorator="['cjgnxyjgz']" :autosize="{ minRows: 4, maxRows: 6 }"/>
    </a-form-item>
    <a-form-item style="margin-left: 24px;" selfUpdate label="有何论文和著作">
      <a-input type="textarea" v-decorator="['yhlwhzz']" :autosize="{ minRows: 4, maxRows: 6 }"/>
    </a-form-item>
    <a-form-item style="margin-left: 24px;" selfUpdate label="自我鉴定">
      <a-input type="textarea" v-decorator="['zwjd']" :autosize="{ minRows: 4, maxRows: 6 }"/>
    </a-form-item>
  </a-form>
</template>
<script>
import { mapState } from 'vuex'
const selectArr = ['TYPE0011', 'TYPE0010' , 'TYPE0088', 'TYPE0078', 'TYPE0017', 'TYPE0037', 'TYPE0013', 'TYPE0012', 'TYPE0002', 'TYPE0015', 'TYPE0020', 'TYPE0001', 'TYPE0305', 'TYPE0024', 'TYPE0018', 'TYPE0023', 'TYPE0090', 'TYPE0006']
function getBase64 (img, callback) {
  const reader = new FileReader()
  reader.addEventListener('load', () => callback(reader.result))
  reader.readAsDataURL(img)
}
export default {
  props: ['info'],
  data () {
    return {
      selectMenu: {},
      loading: false,
      imageUrl: ''
    }
  },
  beforeCreate () {
    this.form = this.$form.createForm(this)
  },
  computed: {
    ...mapState({
      TYPE0006: state => state.app['TYPE0006'], // 职位
      TYPE0090: state => state.app['TYPE0090'], // 学士学位学科门类
      TYPE0023: state => state.app['TYPE0023'], // 入学前最后学位
      TYPE0018: state => state.app['TYPE0018'], // 入学前最后学历
      TYPE0024: state => state.app['TYPE0024'], // 外语熟练程度
      TYPE0305: state => state.app['TYPE0305'], // 学习方式
      TYPE0001: state => state.app['TYPE0001'], // 信仰宗教
      TYPE0020: state => state.app['TYPE0020'], // 政治面貌
      TYPE0015: state => state.app['TYPE0015'], // 国籍/地区
      TYPE0002: state => state.app['TYPE0002'], // 户口性质
      TYPE0012: state => state.app['TYPE0012'], // 婚姻状况
      TYPE0013: state => state.app['TYPE0013'], // 健康状况
      TYPE0037: state => state.app['TYPE0037'], // 港澳台侨
      TYPE0017: state => state.app['TYPE0017'], // 民族
      TYPE0078: state => state.app['TYPE0078'], // 血型
      TYPE0088: state => state.app['TYPE0088'], // 证件类型
      TYPE0011: state => state.app['TYPE0011'], // 性别
      TYPE0010: state => state.app['TYPE0010'], // 性别
    }),
    xh () {
      return this.$route.query.xh
    }
  },
  watch: {
    info (val) {
      if (val.xh) {
        this.initForm()
      }
    }
  },
  created () {
    selectArr.forEach(v => {
      this.$store.dispatch('app/setDictionary', v)
    })
    this.initSelectMenu()
  },
  methods: {
    initForm () {
      // this.$api.student.stuXjInfo(this.xh).then(res => {
      this.$nextTick(() => {
        if (this.info.csdsdm) {
          this.provinceChange(this.info.csdsdm)
        }
        if (this.info.csdcdm) {
          this.cityChange(this.info.csdcdm)
        }
        if (this.info.jgsdm) {
          this.provinceNativeChange(this.info.jgsdm)
        }
        if (this.info.jgcdm) {
          this.cityNativeChange(this.info.jgcdm)
        }

        let keys = Object.keys(this.form.getFieldsValue())
        let obj = {}
        keys.forEach(key => {
          obj[key] = this.info[key]
        })
        this.form.setFieldsValue(obj)
        // this.form.setFieldsValue(this.info)
        // console.log(this.form.getFieldDecorator())
        // this.form.getFieldDecorator(this.info)
        // for (let key in this.info) {
        //   this.form.getFieldDecorator(key, {initialValue: this.info[key]})
        // }
        // this.form.getFieldDecorator('zsnj',{initialValue:res.data.doctoralAdmissionYear}) ;

      })
      // })
    },
    initSelectMenu () {
      let allRequest = [
        this.$api.base.areaList(),
        this.$api.base.majorAll(),
        this.$api.base.schoolInfoQueryAll()
      ]
      Promise.all(allRequest).then(res => {
        this.selectMenu = {
          province: res[0].data,
          zyList: res[1].data,
          schoolList: res[2].data
        }
      })
    },
    handlePChange(v, i, k) {
      this.form.setFieldsValue({k: ''})
      this.$api.base.schoolInfoQueryAll({xzqhsdm: v}).then(res => {
        this.$set(this.selectMenu, `schoolList${i}` , res.data)
      })
    },
    filterOption (value, op) {
      return op.componentOptions.children[0].text.indexOf(value) !== -1
    },
    handleChange (info) {
      if (info.file.status === 'uploading') {
        this.loading = true
        return
      }
      if (info.file.status === 'done') {
        // Get this url from response in real world.
        getBase64(info.file.originFileObj, (imageUrl) => {
          this.imageUrl = imageUrl
          this.loading = false
        })
      }
    },
    beforeUpload (file) {
      const isJPG = file.type === 'image/jpeg'
      if (!isJPG) {
        this.$message.error('You can only upload JPG file!')
      }
      const isLt2M = file.size / 1024 / 1024 < 2
      if (!isLt2M) {
        this.$message.error('Image must smaller than 2MB!')
      }
      return isJPG && isLt2M
    },
    setData (option, key) {
      this.form.setFieldsValue({[key]: option.data.attrs.name})
    },
    save () {
      this.form.validateFields((err, values) => {
        if (err) {
          return
        }
        this.$DateToString(values)
        let params = Object.assign(this.info, values)
        console.log(params)
        this.$api.student.studentUpdate(params).then(res => {
          this.$message('操作成功')
        })
      })
    },
    provinceChange (v) {
      this.form.setFieldsValue({csdcdm: '', csdxqdm: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'city', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'city', [])
      }
      this.$set(this.selectMenu, 'area', [])
    },
    cityChange (v) {
      this.form.setFieldsValue({csdxqdm: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'area', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'area', [])
      }
    },
    provinceNativeChange (v) {
      this.form.setFieldsValue({jgcdm: '', jgxqdm: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'nativeCity', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'nativeCity', [])
      }
      this.$set(this.selectMenu, 'nativeArea', [])
    },
    cityNativeChange (v) {
      this.form.setFieldsValue({jgxqdm: ''})
      if (v) {
        this.$api.base.areaList({parentCode: v}).then(res => {
          this.$set(this.selectMenu, 'nativeArea', res.data)
        })
      } else {
        this.$set(this.selectMenu, 'nativeArea', [])
      }
    }
  }
}
</script>


<style lang="less" scoped>
  .col-wrapper .ant-col-sm-12, .ant-col-md-8{
    min-height: 91px;
  }
</style>
